package org.springblade.mes.purchase.order.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springblade.core.tenant.mp.TenantEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 数据模型
 * @author qp
 */
@Data
@Accessors(chain = true)
@TableName("pur_order_detail")
public class OrderDetail extends TenantEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "订单编号")
	private String orderNo;

	@ApiModelProperty(value = "销售合同编号")
	private String contractNumber;

	@ApiModelProperty(value = "物料原始id")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long originalId;

	@ApiModelProperty(value = "物料编码")
	private String materialNo;

	@ApiModelProperty(value = "物料名称")
	private String materialNameZh;

	@ApiModelProperty(value = "物料组编号")
	private String materialGroupNo;

	@ApiModelProperty(value = "物料组名称")
	private String materialGroupName;

	@ApiModelProperty(value = "物料标识")
	private String materialFlag;

	@ApiModelProperty(value = "物料类型")
	private String materialType;

	@ApiModelProperty(value = "品牌")
	private String brand;

	@ApiModelProperty(value = "项目编号")
	private String projectNo;

	@ApiModelProperty(value = "项目类型")
	private String projectType;

	@ApiModelProperty(value = "项目名称")
	private String projectName;

	@ApiModelProperty(value = "需求单号")
	private String demandNo;

	@ApiModelProperty(value = "需求名称")
	private String demandName;

	@ApiModelProperty(value = "数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal quantity;

	@ApiModelProperty(value = "总数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal totalNum;

	@ApiModelProperty(value = "已签收数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal signedNum;

	@ApiModelProperty(value = "未签收数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal unSignNum;

	@ApiModelProperty(value = "未结算数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal unSettleNum;

	@ApiModelProperty(value = "已结算数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal settledNum;

	@ApiModelProperty(value = "已入库数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal storagedNum;

	@ApiModelProperty(value = "单位")
	private String unit;

	@ApiModelProperty(value = "规格")
	private String specification;

	@ApiModelProperty(value = "型号")
	private String model;

	@ApiModelProperty(value = "未税预算单价")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal untaxedPrice;

	@ApiModelProperty(value = "未税预算金额")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal untaxedAmount;

	@ApiModelProperty(value = "目标交货期")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date targetDeliveryDate;

	@ApiModelProperty(value = "备注")
	private String remark;

	@ApiModelProperty(value = "采购方式")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Integer purchaseMethod;

	@ApiModelProperty(value = "需求单类型")
	private String demandType;

	@ApiModelProperty(value = "采购需求子表ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long demandDetailId;

	@ApiModelProperty(value = "预计到货时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date expectArriveDate;

	@ApiModelProperty(value = "未税金额")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal untaxed;

	@ApiModelProperty(value = "价税合计")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal taxedAll;

	@ApiModelProperty(value = "税额")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal tax;

	@ApiModelProperty(value = "供应商到货评价")
	private String supplierDescr;

	@ApiModelProperty(value = "生产批号")
	private String productionBatch2;

	@ApiModelProperty(value = "最新入库时间")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date lastEntryTime;

	@ApiModelProperty(value = "含税单价")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal untaxedUnitPrice;

	@ApiModelProperty(value = "赠品数量")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private BigDecimal giftNum;

	@ApiModelProperty(value = "产品ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long productId;

	@ApiModelProperty(value = "产品编码")
	private String productNo;

	@ApiModelProperty(value = "产品名称")
	private String productName;

	@ApiModelProperty(value = "委外计划明细ID")
	@JsonSerialize(using = ToStringSerializer.class, nullsUsing = NullSerializer.class)
	private Long planDetailId;

	@ApiModelProperty(value = "材质")
	private String material;

}